package com.car.test;

public class Factory{
public ClassesDao getClassesDao(){
   ClassesDao cd = new ClassesDaoImpl();
   return cd;
}
}

interface ClassesDao{
public void getClassesName();

}

class ClassesDaoImpl implements ClassesDao {
public void getClassesName(){
   System.out.println("A班");
}
}

class test
{
public static void main(String[] args){
   Factory f = new Factory();
   f.getClassesDao().getClassesName();
}
}